<template>
  <view class="normal-login-container">

    <view class="item-wrap" style="margin-bottom: 0">
      <view class="lineBottom10">
        <uni-section title="基础信息" type="line"/>
      </view>

      <view style="margin: 8rpx 20rpx 8rpx 20rpx">
        <uni-forms labelWidth="auto">
          <uni-forms-item label="客户名称:">
            <text>{{ ruleForm.customerName || '-' }}</text>
          </uni-forms-item>

          <uni-forms-item label="合同禀议号:">
            <text>{{ ruleForm.contractNo || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="采购禀议号:">
            <text>{{ ruleForm.purchaseNo || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="车辆归属:">
            <text>{{ ruleForm.ascription || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="车辆产权:">
            <text>{{ ruleForm.propertyRightName || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="车辆大区:">
            <text>{{ ruleForm.region || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="品牌/车系/车型:">
            <text v-if="ruleForm.brandName">{{ ruleForm.brandName }}/</text>
            <text v-if="ruleForm.seriesName">{{ ruleForm.seriesName }}/</text>
            <text>{{ ruleForm.modelName }}</text>
          </uni-forms-item>

          <uni-forms-item label="车架号:">
            <text>{{ ruleForm.vinNo || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="车牌号:">
            <text>{{ ruleForm.carNo || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="车辆状态:">
            <text>{{  handleLabel(dict.type.car_business_type, ruleForm.businessType) }}</text>
          </uni-forms-item>

          <uni-forms-item label="客户类型:">
            <text>{{ handleLabel(dict.type.customer_type, ruleForm.customerType) }}</text>
          </uni-forms-item>

          <uni-forms-item label="逾期时长:">
            <text>{{ ruleForm.overdueDuration || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="处理人:">
            <text>{{ ruleForm.processedByName || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="处理时间:">
            <text>{{ ruleForm.processedByTime || '-'}}</text>
          </uni-forms-item>

          <uni-forms-item label="工单创建时间:">
            <text>{{ ruleForm.workCreateTime || '-' }}</text>
          </uni-forms-item>
        </uni-forms>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: 'basicInfo',//基础信息
  dicts: ['customer_type','car_business_type'],
  props: {
    value: {
      type: Object,
      default: {}
    },
    boole: {
      type: Boolean,
      default: true
    }
  },
  computed: {
    ruleForm: {
      get() {
        let that = this
        const proxy = new Proxy(that.value, {
          get(target, key) {
            return Reflect.get(target, key)
          },
          set(target, key, value) {
            that.$emit('input', {...target, [key]: value})
            return true
          }
        })
        return proxy
      }
    },
    handleLabel() {
      return function (arr, type) {
        let name = '-'
        arr.map((v) => {
          if (type == v.value) {
            name = v.label;
          }
        });
        return name
      }
    }
  },
  watch: {},
  data() {
    return {};
  },
  created() {
  },
  mounted() {
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.car-wrap {
  display: flex;
  flex-direction: column;
  padding: 20rpx 20rpx 20rpx 0;
  border: 1px solid #dadada;
  margin: 10rpx 20rpx;
  border-radius: 8rpx;

}


</style>


